package org.hive.testserver.service.repository.persistence.hibernate.dao;

import java.util.List;

import org.hibernate.SessionFactory;
import org.hive.testserver.service.repository.persistence.hibernate._TestHive;
import org.springframework.orm.hibernate3.HibernateTemplate;

public class TestHiveDaoImpl implements TestHiveDao {

	private  HibernateTemplate hibernateTemplate;
	 
	public void setSessionFactory(SessionFactory sessionFactory) {
		this.hibernateTemplate = new HibernateTemplate(sessionFactory);
	}
	
	@SuppressWarnings("unchecked")
	public List<_TestHive> findAll() {
		return hibernateTemplate.find("from Test_Hive");
	}

	public void save(_TestHive hive) {
		hibernateTemplate.saveOrUpdate(hive);
	}

}
